package com.example.fourth;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.example.fourth.databinding.ActivitySecondBinding;

import java.util.ArrayList;

public class SecondActivity extends AppCompatActivity {

    private static final  String TAG ="SecondActivity" ;

    private ActivitySecondBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivitySecondBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        Intent intent = getIntent();
        String strData = intent.getStringExtra("data");
        Log.i(TAG, "strData: "+strData);
        ArrayList<Integer> list = intent.getIntegerArrayListExtra("list");
        Log.i(TAG, "list: "+list.toString());
        Bundle bundle = intent.getExtras();
        if(bundle != null){
            String bundle1 = bundle.getString("bundle1");
            ArrayList<Integer> list1 = bundle.getIntegerArrayList("list");
            Log.i(TAG, "bundle1: "+bundle);
            Log.i(TAG, "bundle2: "+list1.toString());
        }
        User user = (User)intent.getSerializableExtra("User");
//        if (user != null) {
//            binding.extra.setText("获取的对象：" + user.toString());
//        }

    }
}